import React from 'react'
import { useSelector } from 'react-redux'

const List4 = (props) => {
    const {list} = useSelector((state)=>state)
    const List = list.list

    return (
        <div>
            <ul>
                {
                    List.map((item,index)=>
                                  <li>
                                    {item}
                                    -----
                                    <button onClick={()=>props.del(index)}>删除</button>
                                   </li>)
                }
            </ul>
        </div>
    )
}

export default List4
